<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="css/reset.css">
    <link rel="stylesheet" href="css/all.css">
    <link rel="stylesheet" href="css/style1.css">
    <link rel="stylesheet" href="css/style2.css">
    <link rel="stylesheet" href="css/dlheader.css">
    <link rel="stylesheet" href="css/denglu.css">
    <title>Document</title>
</head>

<body>
    @@include("dlheader.html")
    <div class="content">
        <div class="cont">
            <div class="cont_lt">
                <dl>
                    <dt><img src="./images/denglu_3.png" alt=""></dt>
                    <dd>
                        <h1>万户通</h1>
                        <p>WANHUTONG.COM</p>
                    </dd>
                </dl>
                <p class="zgxb">中 国 箱 包 产 地 直 采 平 台</p>
            </div>
            <div class="cont_rt">
                <h1>登录</h1>
                <input type="text" placeholder="用户名/手机号" name="name">
                <input type="password" placeholder="请输入密码" name="pwd">
                <button class="queren" type="submit" id="Submitzhuce">确认</button>
            </div>
        </div>
    </div>

    @@include("foot.html")
    <script src="./js/jquery.min.js"></script>
    <script>
        // function jump() {
        //     window.open("./Zxjh.html");
        // }
        $('#Submitzhuce').click(function () {     
                var username = $("input[name='name']").val();     
                var password = $("input[name='pwd']").val();     
                var email = $("input[name='emails']").val();     // alert(username);die;
                     // 正则验证
                    
                var reg = /^[0-9a-z]{5,}|_[0-9a-z]{5,}$/i;    
                var regEamil = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;    
                var regPwd = /^(\d|[a-zA-Z]){6,14}$/;     
                if (username == "") {       
                    alert('用户名不能为空');
                    return false;
                } else if (!reg.test(username)) {
                    alert('用户名必须是6位以上的数字字母下划线');
                    return false;
                }    
                if (password == "") {
                    alert('密码不能为空');
                    return false;
                } else if (!regPwd.test(password)) {
                    alert('密码为6-14位数字或字母！');
                    return false;
                }else{
                    // alert('成功');
                    window.open("./Zxjh.html");
                }      //验证用户名唯一性
                     
                $.get('__URL__/getName', {
                    'username': username
                }, function (msg) {       
                    if (msg == 1) {         
                        alert('用户名已存在！');
                        return false;       
                    } else {          
                        $('#form1').submit();       
                    }     
                }) 
            })

    </script>
</body>

</html>